package com.hkd.user_service.api.fallback;

import com.hkd.common.api.ApiResponse;
import com.hkd.common.api.BaseFallBack;
import com.hkd.common.api.BaseFallbackFactory;
import com.hkd.user_service.api.SysUserRoleService;
import com.hkd.user_service.api.entity.SysUserRole;
import org.springframework.stereotype.Component;

/**
 * @author HKD
 * @date 2022/9/4 16:51
 */
@Component
public class SysUserRoleServiceImplFallback extends BaseFallbackFactory<SysUserRoleService> {
    @Override
    public SysUserRoleService create(Throwable throwable) {
        FeignFallback fallback = new FeignFallback();
        fallback.setCause(throwable);
        return fallback;
    }

    public class FeignFallback extends BaseFallBack implements SysUserRoleService {


        @Override
        public ApiResponse insertUserRole(SysUserRole userRole) {
            return defaultFallBack();
        }
    }
}
